import { request } from "@/http/axios"


// 查询菜单列表
export function listMenu(query: any) {
  return request({
    url: '/menu/list',
    method: 'get',
    params: query
  })
}

// 查询菜单详细
export function getMenu(menuId: string) {
  return request({
    url: '/menu/' + menuId,
    method: 'get'
  })
}

// 查询菜单下拉树结构
export function treeselect() {
  return request({
    url: '/menu/treeselect',
    method: 'get'
  })
}

// 新增菜单
export function addMenu(data: any) {
  return request({
    url: '/menu',
    method: 'post',
    data: data
  })
}

// 修改菜单
export function updateMenu(data: any) {
  return request({
    url: '/menu',
    method: 'put',
    data: data
  })
}

// 删除菜单
export function delMenu(menuId: string | number) {
  return request({
    url: '/menu/' + menuId,
    method: 'delete'
  })
}

//获取不包含按钮下拉树列表
export function getTreeselectNoBtn() {
  return request({
    url: '/menu/treeselectNoBtn',
    method: 'get'
  })
}
// 获取路由信息
export function getRouters() {
  return request({
    url: '/menu/getRouters',
    method: 'get'
  })
}